﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KDSugar.Galaxy.API
{
    /// <summary>
    /// 常量类
    /// </summary>
    public class Constant
    {
        /// <summary>
        /// 语言枚举
        /// </summary>
        public enum LanguageTypeEnum
        {
            /// <summary>
            /// 英语
            /// </summary>
            ENG = 1033,
            /// <summary>
            /// 简体中文
            /// </summary>
            CHS = 2052,
            /// <summary>
            /// 繁体中文
            /// </summary>
            CHT = 3076
        }

        /// <summary>
        /// 排序枚举
        /// </summary>
        public enum OrderTypeEnum
        {
            /// <summary>
            /// 正序
            /// </summary>
            Asc,
            /// <summary>
            /// 倒序
            /// </summary>
            Desc
        }

        /// <summary>
        /// 业务单据标识依据枚举
        /// </summary>
        public enum FormIdTagTypeEnum
        {
            /// <summary>
            /// 以单据内码为依据
            /// </summary>
            FID,
            /// <summary>
            /// 以单据编号为依据
            /// </summary>
            BillNo,
            /// <summary>
            /// 以分录内码为依据
            /// </summary>
            EntryId
        }

        /// <summary>
        /// 执行操作未获得返回提示错误模板
        /// </summary>
        public const string EXECUTE_RETURN_NULL_ERROR_STR = "执行{0}操作未获取到返回信息";

        /// <summary>
        /// 获取操作未返回错误信息
        /// </summary>
        /// <param name="_operateName">操作指令</param>
        /// <returns></returns>
        public static string GetExecuteReturnNullErrorStr(string _operateName)
        {
            string name = !string.IsNullOrWhiteSpace(_operateName) ? _operateName : "【未知指令】";
            return string.Format(EXECUTE_RETURN_NULL_ERROR_STR, name);
        }
    }
}
